<div class="sub_section_menu">
    <ul>
        {foreach from=$aCategories item=aItem name=category}
            <li style="position: relative;" class="category{if $iCategoryId == $aItem.id} active open{/if}"><a href="{url link='answer.question.category.'.$aItem.id }" class="js_photo_category">{$aItem.name}
                ({$aItem.total})</a>
                {if Phpfox::getParam('answer.show_sub_category')}
                <ul class="child">
                    {foreach from=$aItem.child item=aSubItem name=subcategory}
                        <li class="sub {if $aSubItem.id == $iCategoryId}active open{/if}" ><a href="{url link='answer.question.category.'.$aSubItem.id}">{$aSubItem.name}
                            ({$aSubItem.total})</a></li>
                    {/foreach}
                </ul>
                {/if}
            </li>
        {/foreach}
    </ul>
</div>